package com.yangjian.main;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;

class JJPoint2d {

	float x;
	float y;
	
	public JJPoint2d(float x, float y) {
		super();
		this.x = x;
		this.y = y;
	}
	public double distance() {
		return Math.sqrt(x * x + y * y);
	}
	public String toString() {
		return "(" + x + "," + y + ")";
	}
	
	@Override
	public boolean equals(Object obj) {		
		if (this.getClass().equals(obj.getClass())) {
			JJPoint2d p = (JJPoint2d) obj;
			if (this.x == p.x && this.y == p.y) {
				return true;
			}
			return false;
		}else {
			return false;
		}		
	}
}
